package cn.ekuma.epos.qkorder.link;

import cn.ekuma.epos.datalogic.I_DataLogicSales;
import cn.ekuma.epos.datalogic.I_DataLogicERP;

import com.openbravo.bean.Product;
import com.openbravo.bean.erp.OperationProductCategory;
import com.openbravo.data.basic.BasicException;
import com.openbravo.data.gui.MessageInf;
import com.openbravo.pos.inventory.model.OperationProductCategoryTableModel;
import com.openbravo.pos.panels.link.AbstractProductLinkTablePanel;

public class JOperationProductCategoryPanel extends AbstractProductLinkTablePanel<OperationProductCategory> {

	public JOperationProductCategoryPanel(I_DataLogicSales dlSales) {
		super(dlSales, new OperationProductCategoryTableModel());
	}

	@Override
	public void baseBeanChanged(Product o) {
		try {
		    tableModel.resert(((I_DataLogicERP)dlSales).listOperationProductCategoryByProduct(this.baseBeanID));	
		} catch (BasicException e) {
			new MessageInf(e).show(this);
			tableModel.resert(null);
		}
	}
}
